package kylin;

import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Properties;
import org.apache.kylin.jdbc.Driver;

public class KylinJdbc {
	public void connentJdbc()
			throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException {
		Driver driver = (Driver) Class.forName("org.apache.kylin.jdbc.Driver").newInstance();
		Properties info = new Properties();
		info.put("user", "ADMIN");
		info.put("password", "KYLIN");
		Connection conn = driver.connect("jdbc:kylin://222.22.91.81:7070/learn_kylin", info);
		Statement state = conn.createStatement();
		System.out.println("1111");
		ResultSet resultSet = state.executeQuery("select * from kylin_account limit 1000");
		System.out.println("1111");
		while (resultSet.next()) {  
			//System.out.println("1111");
			String i=resultSet.getString(3);
			System.out.println(i);
			//System.out.println("1111");
		}
	}

	public static void main(String[] args)
			throws IOException, InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException {
		KylinJdbc ky = new KylinJdbc();
		System.out.println("1111111");
		ky.connentJdbc();
	}
}
